{extend name="main"}
{block name="content"}
<div class="think-box-shadow margin-top-15">
    <div class="padding-top-20" style="max-width:850px">
        <form action="{:request()->url()}" method="post" data-auto="true" class="layui-form layui-card shadow-none">


            <div class="layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>公众号名称</b></label>
                    <div class="layui-input-block">
                        <input  name="about.wxname" required vali-name="公众号名称" placeholder="公众号名称" value="{:sysconf('about.wxname')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>微博名称</b></label>
                    <div class="layui-input-block">
                        <input name="about.weibo_name" required vali-name="微博名称" placeholder="微博名称" value="{:sysconf('about.weibo_name')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>微博地址</b></label>
                    <div class="layui-input-block">
                        <input name="about.weibo" required vali-name="微博地址" placeholder="微博地址" value="{:sysconf('about.weibo')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>官网地址</b></label>
                    <div class="layui-input-block">
                        <input name="about.website" required vali-name="官网地址" placeholder="官网地址" value="{:sysconf('about.website')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>版本信息</b></label>
                    <div class="layui-input-block">
                        <input  name="about.version" required vali-name="版本信息" placeholder="版本信息" value="{:sysconf('about.version')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>客服电话</b></label>
                    <div class="layui-input-block">
                        <input  name="about.service_phone" required vali-name="客服电话" placeholder="请输入客服电话（必填）" value="{:sysconf('about.service_phone')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>体重判定标准</b></label>
                    <div class="layui-input-block">
                        <input  name="about.weight_min_max" number required vali-name="体重判定标准" placeholder="请输入体重判定标准单位（克）" value="{:sysconf('about.weight_min_max')}" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><b>随机颜色</b></label>
                    <div class="layui-input-block">
                        <div id="colorpicker1" data-id="a1"></div>
                        <div id="colorpicker2" data-id="a2"></div>
                        <div id="colorpicker3" data-id="a3"></div>
                        <div id="colorpicker4" data-id="a4"></div>
                        <div id="colorpicker5" data-id="a5"></div>
                        <div id="colorpicker6" data-id="a6"></div>
                        <input type="hidden" name="device.color1" id="a1" value="{:sysconf('device.color1')}">
                        <input type="hidden" name="device.color2" id="a2" value="{:sysconf('device.color2')}">
                        <input type="hidden" name="device.color3" id="a3" value="{:sysconf('device.color3')}">
                        <input type="hidden" name="device.color4" id="a4" value="{:sysconf('device.color4')}">
                        <input type="hidden" name="device.color5" id="a5" value="{:sysconf('device.color5')}">
                        <input type="hidden" name="device.color6" id="a6" value="{:sysconf('device.color6')}">
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="layui-form-item text-center">
                    <button class="layui-btn" type="submit">保存配置</button>
                </div>
        </div>
        </form>
    </div></div>
{/block}
{block name='script'}
<script>
    layui.use(function(){
        var colorpicker = layui.colorpicker;
        colorpicker.render({ // eg1
            elem: '#colorpicker1',
            color: "{:sysconf('device.color1')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
        colorpicker.render({ // eg1
            elem: '#colorpicker2',
            color: "{:sysconf('device.color2')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
        colorpicker.render({ // eg1
            elem: '#colorpicker3',
            color: "{:sysconf('device.color3')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
        colorpicker.render({ // eg1
            elem: '#colorpicker4',
            color: "{:sysconf('device.color4')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
        colorpicker.render({ // eg1
            elem: '#colorpicker5',
            color: "{:sysconf('device.color5')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
        colorpicker.render({ // eg1
            elem: '#colorpicker6',
            color: "{:sysconf('device.color6')}",
            format: 'hex', // 默认为 hex
            done: function(color){
                console.log(color)
                let id = this.elem.attr("data-id");
                $("#"+id).val(color);
            }
        });
    });
</script>
{/block}